package com.gxa.controller.fwgl.hlgl;

import com.gxa.pojo.dto.fwgl.CheckInDto;
import com.gxa.pojo.dto.fwgl.NormalInDto;
import com.gxa.pojo.entity.fwgl.TCheckIn;
import com.gxa.pojo.entity.fwgl.TServicemanage;
import com.gxa.service.fwgl.hlgl.ServMService;
import com.gxa.service.fwgl.yhgl.CheckInService;
import com.gxa.utils.QueryResult;
import com.gxa.utils.Result;
import com.gxa.utils.ResultUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author：lizhijun
 * @Package：{PROJECT_NAME}
 * @name：{DATE} {NAME}
 */
@RestController
@RequestMapping("/service")
public class ServiceController {
    @Resource
    private ServMService servMService;

    @GetMapping("/queryAll")
    public Result queryAll(NormalInDto normalInDto){
        QueryResult queryResult = servMService.queryAll(normalInDto);
        return ResultUtils.buildSuccess(queryResult.getData(),queryResult.getCount());
    }

    @RequestMapping("/add")
    public Result addCheckIn(TServicemanage servicemanage){
        servMService.add(servicemanage);
        return ResultUtils.buildSuccess();
    }

    @RequestMapping("/update")
    public Result updateCheckIn(TServicemanage servicemanage){
        servMService.update(servicemanage);
        return ResultUtils.buildSuccess();
    }

    @RequestMapping("/delete")
    public Result deleteCheck(Integer id){
        servMService.delete(id);
        return ResultUtils.buildSuccess();
    }
//搜索
//    @RequestMapping("/find")
//    public Result findTypeByName(String patientName){
//        servMService.findByName(patientName);
//        return ResultUtils.buildSuccess();
//    }
}
